home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / setpgms.zip / SETDIR.DOC < prev    next >
Text File  |  1986-11-23  |  1KB  |  25 lines

  1. SETDIR   Use to restore the current directory
  2.  
  3. SETDIR sets the environment string 'CURDIR' with the current directory. Once 
  4. this has been done it is very simple to restore the current directory after it 
  5. has been changed. To restore the current directory, simply issue the following 
  6. command: 
  7.   
  8.                   CD %CURDIR%
  9.  
  10. This technique has distinct advantages over other techniques that create files
  11. (i.e. CD >CURDIR.FIL) or modify the interupt vector (PUSHDIR/POPDIR from PC 
  12. magazine and PC OUTLINE). It is much faster, creates no files, cannot be 
  13. impacted by programs that modify the interrupt vector, and requires only 
  14. one very small program.
  15.  
  16. If you desire setting another environment variable, use the following:
  17.  
  18.                  SETDIR
  19.                  SET name=%CURDIR%
  20.  
  21. Note that due to limitations in DOS, the errorlevel can be 0 even if
  22. SETDIR fails due to lack of environment space. Errorlevels 1 and 2
  23. are for SETDIR errors. Errorlevel=1 means the DOS release is not at least 2. 
  24. Errorlevel=2 means that the directory string was too long to return.
  25.